﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using DTO;

namespace DAO
{
    public class PHIEUDATCHO_DAO
    {
        #region 1. Inserting
        public static bool ThemPhieuDatCho(PHIEUDC_DTO pdc)
        {
            bool result = false;
            try
            {
                // Create List Sql Parameter
                List<SqlParameter> sqlParams = new List<SqlParameter>();
                sqlParams.Add(new SqlParameter("@SoLuongKhach", pdc.SoLuongKhach));
                sqlParams.Add(new SqlParameter("@MaChuyenDL",pdc.MaChuyenDL));
                sqlParams.Add(new SqlParameter("@MaKH", pdc.MaKH));
                // Call Store Procedure
                int n = SqlDataAccessHelper.ExecuteNoneQuery("InsertPhieuDatCho", sqlParams);

                if (n == 1)
                    result = true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return result;
        }
        #endregion
    }
}
